<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>订单查询</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		$(":input").prop("disabled", true);
		<shiro:hasPermission name="orders:plat:edit">
			$(".edit").prop("disabled", false);
		</shiro:hasPermission>
		$("select").prop("disabled", true);
		$("#btnCancel").prop("disabled", false);
		$(":submit").prop("disabled", false);
	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
	function editOrderMoney(id) {
		if(confirm("确定修改订单数据吗?")){
			$("#viewForm").attr("action","${pageContext.request.contextPath }/a/orders/tOrders/editOrder?orderid=${tOrders.orderid}");
			$("#viewForm").submit();
		}
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/orders/tOrders/busOrderList">订单一览</a></li>
		<li class="active"><a
			href="${ctx}/orders/tOrders/busOrdersForm?id=${tOrders.orderid}">订单查询</a></li>
	</ul>
	<br />
	<form:form id="viewForm" modelAttribute="tOrders"
		class="form-horizontal" action="${ctx}/orders/tOrders/orderback?id=${tOrders.orderid}">
		<form:hidden path="id" />
		<sys:message content="${message}" />
		<div class="control-group">
			<label class="control-label">订单号：</label>
			<div class="controls">
				<form:input path="orderid" htmlEscape="false" class="span4 digits"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单名称：</label>
			<div class="controls">
				<form:input path="ordername" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单日期：</label>
			<div class="controls">
				<input id='createDate' name='createDate' type='text' class="span4"
							value ='<fmt:formatDate value="${tOrders.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/>'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单状态：</label>
			<div class="controls">
				<form:select path="orderstatus" class="span4 required">
					<form:options items="${fns:getDictList('orderstatus')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单金额：</label>
			<div class="controls">
				<input type='text' class="span4 edit" value ='${tOrders.dueamount }' name="dueamount"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车队报价：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.offermount }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出发地：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.departcity }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">目的地：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.destcity }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">上(下)车地点：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.boardaddr }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出发时间：</label>
			<div class="controls">
				<input type='text'
					value='<fmt:formatDate value="${tOrders.departdate}" pattern="yyyy-MM-dd HH:mm:ss"/>'
					class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">包车天数：</label>
			<div class="controls">
				<form:input path="bookingdays" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车辆数：</label>
			<div class="controls">
				<form:input path="purchasenum" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型：</label>
			<div class="controls">
				<input type='text' readonly value="${tOrders.cartype.typename}"
					class="span4" />
				<c:if test="${tOrders.ordertype eq 'c' && not empty tOrders.realsche.typeremarks}">
				(${tOrders.realsche.typeremarks})
				</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">品牌：</label>
			<div class="controls">
				<input type='text' readonly value="${tOrders.cartype.typedesc}"
					class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人姓名：</label>
			<div class="controls">
				<form:input path="contacts" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人电话：</label>
			<div class="controls">
				<form:input path="payertel" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">行程备注：</label>
			<div class="controls">
			<c:choose>
			<c:when test="${tOrders.ordertype eq 'c'}">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.realsche.modeldesc}&#13;&#10;${tOrders.remarks}</textarea>
			</c:when>
			<c:otherwise>
				<textarea  readonly style="width:280px;height:100px;">${tOrders.remarks}</textarea>
			</c:otherwise>
			</c:choose>
			</div>
		</div>
		<c:if test="${tOrders.ordertype eq '7'}">
			<div class="control-group">
			<label class="control-label">客户名称：</label>
			<div class="controls">
				<input name="clientname" type='text' readonly value=${tOrders.clientname }  />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">业务员：</label>
			<div class="controls">
				<input name="merchandiser" type='text' readonly value=${tOrders.merchandiser } />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含路杂费：</label>
			<div class="controls">
				<input name="roadfees" type="radio"  readonly <c:if test="${tOrders.roadfees eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="roadfees" type="radio"  readonly <c:if test="${tOrders.roadfees eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含油：</label>
			<div class="controls">
				<input name="oil" type="radio" readonly  <c:if test="${tOrders.oil eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="oil" type="radio" readonly  <c:if test="${tOrders.oil eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含驾驶员住宿：</label>
			<div class="controls">
				<input name="driverlodge" type="radio" readonly <c:if test="${tOrders.driverlodge eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="driverlodge" type="radio" readonly <c:if test="${tOrders.driverlodge eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含税：</label>
			<div class="controls">
				<input name="tax" type="radio" readonly <c:if test="${tOrders.tax eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="tax" type="radio" readonly <c:if test="${tOrders.tax eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">现收：</label>
			<div class="controls">
				<input name="nowpay" type='text' class="edit" value=${tOrders.nowpay } />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">定金：</label>
			<div class="controls">
				<input name="downpay" type='text' class="edit"  value=${tOrders.downpay } />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">挂账：</label>
			<div class="controls">
				<input name="ownpay" type='text' class="edit" value=${tOrders.ownpay } />
			</div>
		</div>
		<%-- <div class="control-group">
		<label class="control-label">支付方式：</label>
			<div class="controls">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.orderRemarks}</textarea>
			</div>
		</div> --%>
		</c:if>
		<c:if test="${tOrders.ordertype eq '2'}">
			
		<div class="control-group">
			<label class="control-label">是否包含路杂费：</label>
			<div class="controls">
				<input name="roadfees" type="radio"  readonly  checked="checked"/>&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="roadfees" type="radio"  readonly  />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含油：</label>
			<div class="controls">
				<input name="oil" type="radio" readonly   />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="oil" type="radio" readonly  checked="checked" />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含驾驶员住宿：</label>
			<div class="controls">
				<input name="driverlodge" type="radio" readonly checked="checked" />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="driverlodge" type="radio" readonly  />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含税：</label>
			<div class="controls">
				<input name="tax" type="radio" readonly  />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="tax" type="radio" readonly checked="checked" />&nbsp;否
			</div>
		</div>
		<%-- <div class="control-group">
		<label class="control-label">支付方式：</label>
			<div class="controls">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.orderRemarks}</textarea>
			</div>
		</div> --%>
		</c:if>
		<c:if test="${tOrders.ordertype eq '5' || tOrders.ordertype eq '6' || tOrders.ordertype eq 'c' }">
			
		<div class="control-group">
			<label class="control-label">是否包含路杂费：</label>
			<div class="controls">
				<input name="roadfees" type="radio"  readonly  checked="checked"/>&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="roadfees" type="radio"  readonly  />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含油：</label>
			<div class="controls">
				<input name="oil" type="radio" readonly   checked="checked"/>&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="oil" type="radio" readonly   />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含驾驶员住宿：</label>
			<div class="controls">
				<input name="driverlodge" type="radio" readonly  />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="driverlodge" type="radio" readonly  checked="checked"/>&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含税：</label>
			<div class="controls">
				<input name="tax" type="radio" readonly  checked="checked" />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="tax" type="radio" readonly  />&nbsp;否
			</div>
		</div>
		<%-- <div class="control-group">
		<label class="control-label">支付方式：</label>
			<div class="controls">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.orderRemarks}</textarea>
			</div>
		</div> --%>
		</c:if>
		
		<div class="form-actions">
			<input id="btnCancel" class="btn" type="button" value="返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 回"
				onclick="history.go(-1)" /> 
			<shiro:hasPermission name="orders:bus:edit">
			<c:if test="${tOrders.orderstatus == 0 }">
				<a class="btn btn-warning" href="${ctx}/orders/tOrders/orderback?id=${tOrders.orderid}">车队退单</a>
			</c:if>
			</shiro:hasPermission>
			<shiro:hasPermission name="orders:plat:edit">
				<a class="btn btn-primary" href="javascript:void(0)" onclick="editOrderMoney(${tOrders.orderid})">修改订单金额</a>
			</shiro:hasPermission>
		</div>
	</form:form>
</body>
</html>